//Page Object
import Toast from '@vant/weapp/toast/toast';
Page({
  data: {
    showLoading:true,
    show:false,
    date:'',
    minDate: (new Date(2025, 1, 1)).getTime(),
    maxDate: (new Date(2025, 8, 10)).getTime(),
    defaultDate: new Date(2025, 4, 1).getTime(),
  },
  //options(Object)
  onLoad: function(options){
   
    
  },
  showToast(){
    this.setData({
      show:true
    })
    // Toast.clear()
    // Toast({
    //   type:'text',
    //   message:'hello world',
    //   position:'top'
    // })
  },
  formatDate(date) {
    date = new Date(date);
    return `${date.getMonth() + 1}/${date.getDate()}`;
  },
  onDisplay(){
    this.setData({
      show:true
    })
  },
  onClose(){
    this.setData({
      show:false
    })
  },
  onConfirm(event){
    console.log('event.detail:',event.detail)
    this.setData({
      show:false,
      date:this.formatDate(event.detail)
    })
  }
  
});